package com.lg.system.user.entity;
import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotNull;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.lg.common.validate.Insert;
import com.lg.common.validate.Update;
import com.lg.utils.Page;
import com.lg.utils.PageModel;
/**
 * @author dl
 * @since 2018-03-16
 */
@TableName("sys_user")
@JsonIgnoreProperties(value={Page.sort,Page.order,Page.rows,Page.total,Page.limit,Page.offset,Page.code},allowSetters=true)
public class UserEntity extends PageModel {

    /**
	 * 
	 */
	
	@TableField(exist=false)
	private static final long serialVersionUID = 1L;

	@TableId(value = "user_id", type = IdType.AUTO)
    @NotNull(message="用户ID不能为空!")
    private Long userId;
	
	@TableField(exist=false)
	@NotNull(message="角色不能为空",groups={Insert.class,Update.class})
	private Long roleIds[];

    /**
     * 用户名
     */
    private String username;

    private String name;

    /**
     * 密码
     */
    private String password;

    @TableField("dept_id")
    private Long deptId;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 状态 0:禁用，1:正常
     */
    private Integer status;

    /**
     * 创建用户id
     */
    @TableField("create_id")
    private Long createId;

    @TableField("modified_id")
    private Long modifiedId;

    /**
     * 创建时间
     */
    @TableField("gmt_create")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @TableField("gmt_modified")
    private Date gmtModified;

    /**
     * 性别
     */
    private Long sex;

    /**
     * 出身日期
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    private Date birth;

    @TableField("pic_id")
    private Long picId;

    /**
     * 现居住地
     */
    @TableField("live_address")
    private String liveAddress;

    /**
     * 爱好
     */
    private String hobby;

    /**
     * 省份
     */
    private String province;

    /**
     * 所在城市
     */
    private String city;

    /**
     * 所在地区
     */
    private String district;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }
    public Long getModifiedId() {
        return modifiedId;
    }

    public void setModifiedId(Long modifiedId) {
        this.modifiedId = modifiedId;
    }
    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }
    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }
    public Long getSex() {
        return sex;
    }

    public void setSex(Long sex) {
        this.sex = sex;
    }
    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }
    public Long getPicId() {
        return picId;
    }

    public void setPicId(Long picId) {
        this.picId = picId;
    }
    public String getLiveAddress() {
        return liveAddress;
    }

    public void setLiveAddress(String liveAddress) {
        this.liveAddress = liveAddress;
    }
    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }
    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }
    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }
    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }
    

    public Long[] getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(Long[] roleIds) {
		this.roleIds = roleIds;
	}

	@Override
    public String toString() {
        return "User{" +
        "userId=" + userId +
        ", username=" + username +
        ", name=" + name +
        ", password=" + password +
        ", deptId=" + deptId +
        ", email=" + email +
        ", mobile=" + mobile +
        ", status=" + status +
        ", createId=" + createId +
        ", modifiedId=" + modifiedId +
        ", gmtCreate=" + gmtCreate +
        ", gmtModified=" + gmtModified +
        ", sex=" + sex +
        ", birth=" + birth +
        ", picId=" + picId +
        ", liveAddress=" + liveAddress +
        ", hobby=" + hobby +
        ", province=" + province +
        ", city=" + city +
        ", district=" + district +
        "}";
    }
}
